Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Unused Imports #76

Merged
merged 7 commits into from
Sep 15, 2024
Merged

Remove Unused Imports #76

merged 7 commits into from
Sep 15, 2024

Conversation

parisosuch-dev
Copy link
Member

  • Removed unused imports.
  • Removed unused variables.

Solves issue #72.

@parisosuch-dev
Copy link
Member Author

Why did my unit testing fail huh?

@brennanfreeze
Copy link
Member

Why did my unit testing fail huh?

The "check" variable, although a bit rustic was used to make sure that the user when calling the usage of a GPU without CUDA installed wouldnt throw an error, since Github's CI don't have access to one it failed:

 try:
                check = subprocess.check_output(["nvcc", "--version"]).decode()
                self.calculator = GpuCalculator(qubits, big_endian, prep)
except FileNotFoundError:
                print("ERROR: CUDA NOT INSTALLED. SWITCHING TO BASE...")

@parisosuch-dev
Copy link
Member Author

Oh if that is the case, then we should just be calling subprocess.check_output().decode() without assigning the return to a variable. It should work then?

@parisosuch-dev
Copy link
Member Author

@brennanfreeze I see what you are doing now, you are calling a command in subprocess to verify if nvcc is installed. If it isn't the command raises an error and you catch that error. There might be a better way to do this (i am not aware of one). I added the function call and just skipped the variable assignment and it works now. Thanks! 👍🏼

@parisosuch-dev parisosuch-dev linked an issue Sep 15, 2024 that may be closed by this pull request
@brennanfreeze
Copy link
Member

brennanfreeze commented Sep 15, 2024

@brennanfreeze I see what you are doing now, you are calling a command in subprocess to verify if nvcc is installed. If it isn't the command raises an error and you catch that error. There might be a better way to do this (i am not aware of one). I added the function call and just skipped the variable assignment and it works now. Thanks! 👍🏼

Pretty much! I agree with you there totally is that isnt using a unused variable, but I think for the time being it is fine.

Edit: did not see the removal of the variable, which is even better lol

Copy link
Member

@brennanfreeze brennanfreeze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@brennanfreeze brennanfreeze merged commit 6166733 into main Sep 15, 2024
2 checks passed
@brennanfreeze brennanfreeze deleted the refactor/remove-unused-imports branch September 15, 2024 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Unused Imports
2 participants